package com.zzl.bonds.ticket.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zzl.bonds.ticket.dto.BusinessContractAddDto;
import com.zzl.bonds.ticket.dto.BusinessContractUpdateDto;
import com.zzl.bonds.ticket.entity.BusinessContractEntity;
import com.zzl.general.common.exception.SysException;
import com.zzl.general.common.serurity.entity.User;
import com.zzl.general.common.utils.PageUtils;

import java.util.List;
import java.util.Map;

/**
 * 电子合同表
 *
 * @author gull
 * @date 2022-07-06 13:43:52
 */
@SuppressWarnings("javadoc")
public interface BusinessContractService extends IService<BusinessContractEntity> {

    /**
     * 分页查询
     *
     * @param params 查询参数
     * @return 分页数据
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 新增
     *
     * @param businessContractAddDto 新增实体
     * @param user                   当前登录用户
     * @throws SysException 业务异常
     */
    void saveBusinessContract(BusinessContractAddDto businessContractAddDto, User user) throws SysException;

    /**
     * 修改
     *
     * @param businessContractUpdateDto 修改实体
     * @param user                      当前登录用户
     * @throws SysException 业务异常
     */
    void updateBusinessContractById(BusinessContractUpdateDto businessContractUpdateDto, User user) throws SysException;

    /**
     * 通过票的id查 相关合同
     *
     * @param businessId 票据id
     * @param code  业务场景枚举
     * @return
     */
    List<BusinessContractEntity> getByTicketId(String businessId, Integer code);
}

